<?php 
namespace App\Http\Controllers\Admin;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use App\Http\Controllers\org\upload;
// require_once '/app/Http/Controllers/org/upload.php';
class CommonController extends Controller {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{
		//
	}
	// 递归获得所有的分类
	public function digui($data,$pid){
		$arr = array();
		foreach ($data as $k => $v) {
			if($v->pid == $pid){
				$v->n = $this->digui($data,$v->cid);
				$arr[] = $v;
			}
			
		}
		return $arr;
	}
	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function up()
	{
		$up = new Upload();
		$up->up();
	}

	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}

	/**
	 * Display the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function show($id)
	{
		//
	}

	/**
	 * Show the form for editing the specified resource.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function edit($id)
	{
		//
	}

	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}

	/**
	 * Remove the specified resource from storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function destroy($id)
	{
		//
	}

}
